package top.deepdesigner.handler;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

/**
 * Start up <br/>
 * Created with IntelliJ IDEA. <br/>
 * Project Name: shop_manage <br/>
 * Author: duanruiqing <br/>
 * DateTime: 2022/9/23 星期五 21:35:48 <br/>
 */
public class String2LongHandler extends JsonSerializer<String> {

  @Override
  public void serialize(String s, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
    Long aLong = new Long(s);
    jsonGenerator.writeObject(aLong);
  }
}
